@extends('default.layouts.personalPublic')
@section('title')个人中心我的简历@endsection
{{--CSS部分--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/personal/resumeBasic.css')}}">
    <link rel="stylesheet" type="text/css" href="{{asset('/default/css/personal/place.css')}}">

@endsection
{{--右边主体内容部分--}}
@section('rightcon')
    <div class="right">
        <div class="rightMain">
            {{--简历错误信息--}}
            @if(count($errors)>0)
                <div class="errors">
                    <ul>
                        @if(is_object($errors))
                            @foreach($errors->all() as $error)
                                <li><span>{{$error}}</span></li>
                            @endforeach
                        @else
                            <li><span>{{$error}}</span></li>
                        @endif
                    </ul>
                </div>
            @endif

            <div class="basicInformation"><h2>Create my English resume</h2></div>
            <div class="jobInfo">
                <form action="{{url("personal/english/basic_info")}}" method="post" name="resumeForm" id="resumeForm">
                    {{csrf_field()}}
                    {{--基本资料--}}

                    <dl>
                        <dt><span class="caption">{{ trans('english.name') }}</span><span class="asterisk">*</span></dt>
                        <dd><input type="text" class="pleaseName"  name="name" id="name" value="{{ old('name') }}"
                                   placeholder="{{ trans('english.PleaseName') }}" tip="{{ trans('english.PleaseName') }}"/></dd>
                        <dd  class="errinfo"></dd>
                    </dl>

                    <dl>
                        <dt><span class="caption">{{ trans('english.sex') }}</span><span class="asterisk">*</span></dt>
                        <dd>
                            <span>
                                <input type="radio" name="sex" id="sex1" class="radios" checked value="1"/>
                                <label for="sex1">man</label>
                            </span>
                             <span class="mLeftTen">
                                <input type="radio" name="sex" id="sex2" class="radios" value="2"/>
                                <label for="sex2">woman</label>
                            </span>
                        </dd>
                        <dd  class="errinfo"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.dateOfBirth') }}</span><span class="asterisk">*</span></dt>
                        <dd>
                            <div class="showTime" id="showTime">
                                <input name="birthday" id="birthday" type="hidden" value="{{old('birthday')}}">
                            </div>
                        </dd>
                        <dd  class="errinfo"></dd>
                    </dl>

                    <dl>
                        <dt><span class="caption">{{ trans('english.highest') }}</span><span class="asterisk">*</span></dt>
                        <dd>
                            <input id="education" name="education" type="hidden">
                            <div id="education_select" class="select"  ><span><a></a></span><i></i></div>
                        </dd>
                        <dd  class="errinfo"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.handSon') }}</span><span class="asterisk">*</span></dt>
                        <dd>
                            <input id="work_year" name="work_year" type="hidden">
                            <div id="work_year_select" class="select"  ><span><a></a></span><i></i></div>
                        </dd>
                        <dd  class="errinfo"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.cellPhone') }}</span><span class="asterisk">*</span></dt>
                        <dd><input type="text" name="mobile" id="mobile" value="{{ $user->mobile }}" style="width: 120px;"
                                   placeholder="{{ trans('english.PleasePhone') }}" tip="{{ trans('english.PleasePhone') }}"/></dd>
                        <dd  class="errinfo" id="mobileErr"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.mailbox') }}</span></dt>
                        <dd><input type="text" name="email" id="email" value="{{ $user->email }}"
                                   placeholder="{{ trans('english.PleaseEmail') }}" tip="{{ trans('english.PleaseEmail') }}"/></dd>
                        <dd  class="errinfo"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.QQNumber') }}</span></dt>
                        <dd><input type="text" name="qq" id="qq" value="{{ old('qq') }}"  style="width: 150px;"
                                   placeholder="{{ trans('english.PleaseQQ') }}" tip="{{ trans('english.PleaseQQ') }}"/></dd>
                        <dd  class="errinfo"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.jobStatus') }}</span><span class="asterisk">*</span></dt>
                        <dd>
                            <input id="job_status" name="job_status" type="hidden">
                            <div id="job_status_select" class="select"   style="width: 200px;"><span><a></a></span><i></i></div>
                        </dd>
                        <dd  class="errinfo"></dd>
                    </dl>

                    <dl>
                        <dt><span class="caption">{{ trans('english.livingPlace') }}</span><span class="asterisk">*</span></dt>
                        <dd>
                            <input id="homeaddress" name="homeaddress" type="hidden" value="{{old('homeaddress')}}" >
                            <input id="province" name="province" type="hidden" >
                            <div id="province_select" class="select"  ><span><a></a></span><i></i></div>
                            <input id="area" name="area" type="hidden">
                            <div id="area_select" class="select" style="margin-left: 5px;" ><span><a></a></span><i></i></div>
                            <input id="city" name="city" type="hidden">
                            <div id="city_select" class="select" style="margin-left: 5px;"><span><a></a></span><i></i></div>
                        </dd>
                        <dd  class="errinfo"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.Location') }}</span></dt>
                        <input id="longitude" name="longitude" value="{{old('longitude')}}" type="hidden">
                        <input id="latitude" name="latitude"  value="{{old('latitude')}}" type="hidden">
                        <input id="place_name" name="place_name"  value="{{old('place_name')}}" type="hidden">
                        <dd>
                            <span class="set_place" id="set_place">{{ trans('english.Nearby') }}</span>
                        </dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.detailedAddress') }}</span></dt>
                        <dd><input type="text" name="address" id="address" value="{{ old('address') }}"  style="width: 340px;"
                                   placeholder="{{ trans('english.PleaseAddress') }}" tip="{{ trans('english.PleaseAddress') }}"/></dd>
                        <dd  class="errinfo"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.operatingPost') }}</span><span class="asterisk">*</span></dt>
                            <input name="jobsort1" type="hidden" id="jobsort1" value="{{old('jobsort1')}}">
                            <input name="jobsort2" type="hidden" id="jobsort2" value="{{old('jobsort2')}}">
                            <input name="jobsort3" type="hidden" id="jobsort3" value="{{old('jobsort3')}}">
                            <input name="jobsort4" type="hidden" id="jobsort4" value="{{old('jobsort4')}}">
                            <input name="jobsort5" type="hidden" id="jobsort5" value="{{old('jobsort5')}}">
                        <dd>
                            <span class="jList" id="posCateInput">
                                <input type="text" name="jobsort" id="jobsort" value="{{old('jobsort')}}" readonly  style="cursor: text"
                                       placeholder="{{ trans('english.PleaseJob') }}"/>
                                <i></i>
                            </span>
                        </dd>
                        <dd  class="errinfo"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.operational') }}</span><span class="asterisk">*</span></dt>
                            <input name="jobarea1" type="hidden" id="jobarea1" value="{{old('jobarea1')}}">
                            <input name="jobarea2" type="hidden" id="jobarea2" value="{{old('jobarea2')}}">
                            <input name="jobarea3" type="hidden" id="jobarea3" value="{{old('jobarea3')}}">
                            <input name="jobarea4" type="hidden" id="jobarea4" value="{{old('jobarea4')}}">
                            <input name="jobarea5" type="hidden" id="jobarea5" value="{{old('jobarea5')}}">
                        <dd>
                            <span class="jList" id="workplaceInput" >
                                <input type="text" name="workplace" id="workplace" value="{{old('workplace')}}" readonly  style="cursor: text"
                                       placeholder="{{ trans('english.PleaseArea') }}"/>
                                <i></i>
                            </span>
                        </dd>
                        <dd  class="errinfo"></dd>
                    </dl>

                    <dl>
                        <dt><span class="caption">{{ trans('english.household') }}</span></dt>
                        <dd>
                            <input id="census" name="census" type="hidden" value="{{old('census')}}" >
                            <input id="cprovince" name="cprovince" type="hidden" >
                            <div id="cprovince_select" class="select"  ><span><a></a></span><i></i></div>
                            <input id="carea" name="carea" type="hidden">
                            <div id="carea_select" class="select" style="margin-left: 5px;" ><span><a></a></span><i></i></div>
                            <input id="ccity" name="ccity" type="hidden">
                            <div id="ccity_select" class="select" style="margin-left: 5px;"><span><a></a></span><i></i></div>
                        </dd>
                        <dd  class="errinfo"></dd>
                    </dl>

                    <dl>
                        <dt><span class="caption">{{ trans('english.marital') }}</span></dt>
                        <dd>
                            <input id="marital" name="marital" type="hidden">
                            <div id="marital_select" class="select" style="width:140px;">
                                <span><a></a></span><i></i></div>
                        </dd>
                        <dd class="errinfo"></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.height') }}</span></dt>
                        <dd>
                            <input type="text" style="width:90px;" name="height" id="height"
                                   value="" placeholder="{{ trans('english.PleaseHeight') }}"/>
                            <span style="margin-left: 5px;">cm</span>
                        </dd>
                        <dd class="errinfo"></dd>
                    </dl>


                    <dl>
                        <dt><span class="caption">{{ trans('english.Intention') }}</span><span class="asterisk">*</span></dt>
                        <dd><input type="text" name="intentionjobs" id="intentionjobs" tip="{{ trans('english.PleaseIntention') }}"
                                   value="{{ old('intentionjobs') }}" placeholder="{{ trans('english.PleaseIntention') }}"/></dd>
                        <dd  class="errinfo"></dd>
                    </dl>

                    <dl>
                        <dt><span class="caption">{{ trans('english.salary') }}</span></dt>
                        <dd>
                            <input id="expectedsalary" name="expectedsalary" type="hidden">
                            <div id="expectedsalary_select" class="select" style="width: 130px;">
                                <span><a></a></span><i></i></div>
                            <span style="float: left; margin-left: 5px;">Yuan/Month</span>
                            <div class="isexpectedsalary"><input type="checkbox" class="checkBox"
                                                                 name="isexpectedsalary" id="isexpectedsalary"
                                                                 value="1">
                                <label for="isexpectedsalary">According to negotiable</label></div>
                        </dd>
                        <dd class="errinfo"></dd>
                    </dl>

                    <dl style=" height: 72px;">
                        <dt style="height: 72px;"><span class="caption">{{ trans('english.evaluation') }}</span></dt>
                        <dd style="height: 72px;"><textarea name="introduction" id="introduction"
                                                             placeholder="{{ trans('english.PleaseSkills') }}"></textarea></dd>
                    </dl>
                    <dl>
                        <dt><span class="caption">{{ trans('english.ResumeName') }}</span></dt>
                        <dd><input type="text" name="resume_name" id="resume_name" value="My resume"
                                   style="width:350px;" placeholder="{{ trans('english.PleaseProvide') }}" tip="{{ trans('english.PleaseProvide') }}"/></dd>
                        <dd  class="errinfo"></dd>
                    </dl>
                    <dl style="margin-top:25px;">
                        <dt></dt>
                        <dd><input name="sub" class="subs btn" type="submit" value="{{ trans('english.conservation') }}"></dd>
                    </dl>
                </form>
            </div>
        </div>
        <div class="stopper"></div>
    </div>

@endsection
{{--JS部分--}}
@section('footerjs')
    @parent
    <script type="text/javascript" src="{{EnResources::jsOption('my_resume')}}"></script>
    <script type="text/javascript" src="{{EnResources::jsOption(['work_year'])}}"></script>

    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.validate.extend.js')}}"></script>
    <!--弹出层显示时间加载插件-->
    <script type="text/javascript" src="{{asset('/default/js/jquery/enjquery.autoTime.js')}}"></script>
    {{--工作岗位--}}
    <script type="text/javascript" src="{{asset('/default/js/jquery/enjquery.position.js')}}"></script>
    {{--工作地区--}}
    <script type="text/javascript" src="{{asset('/default/js/jquery/enjquery.area.js')}}"></script>
    <!--地区三级联动-->
    <script type="text/javascript" src="{{asset('/default/js/jquery/enjquery.select.area.js')}}"></script>
    {{--简历基本资料验证--}}
    <script type="text/javascript" src="{{asset('/default/js/personal/enmy_resume.js')}}"></script>
    {{--设置地标--}}
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.setPlace.js')}}"></script>
    <script>
        var _token = '{{csrf_token()}}';
        $(function(){
            $('#resume_en').addClass('on').find('i').css('background-position', '-26px 0px');
            var  closeImg = "{{asset('/default/images/logo.png')}}";
            //基于包装集autoTime函数插件
            $("#showTime").autoTime({
                year:"year",                               //弹出层年份
                month:"month",                             //弹出层月份
                established:'#birthday'                 //成立年份id
            });
            //工作经验
            var selectWorkYear =  $("#work_year").select({
                defaults:null,//默认按索引选中null为不选
                defaultFill:[{"value": '', "text": "{{ trans('english.PleaseSelect') }}"}],//当defaults为null时,填空使用这个
                optionData:option_work_year,
                selected:'{{old('work_year')}}'
            });
            //最高学历
            var selectEducation = $("#education").select({
                defaults:null,//默认按索引选中null为不选
                defaultFill:[{"value": '', "text": "{{ trans('english.PleaseSelect') }}"}],//当defaults为null时,填空使用这个
                optionData:option_education,
                selected:'{{old('education')}}'
            });
            //在职状态
            var selectJobStatus = $("#job_status").select({
                defaults:null,//默认按索引选中null为不选
                defaultFill:[{"value": '', "text": "{{ trans('english.PleaseSelect') }}"}],//当defaults为null时,填空使用这个
                optionData:option_job_status,
                selected:'{{old('job_status')}}'
            });
            //设置地标
            $('.jobInfo').setPlace({
                longitude: "#longitude",    		//设置地标经度
                latitude: "#latitude", 				//设置地标纬度
                place_name: "#place_name",			//设置地标(乡镇)名称
                set_place: "#set_place",       		//地标的点击按钮
                homeaddress: '#homeaddress',   	    //选择那个县级市下面的居住地
                place_url: '/personal/english/place_map'   //地标地图url
            });
            //婚姻状况
            var selectMarital = $("#marital").select({
                defaults:null,//默认按索引选中null为不选
                defaultFill:[{"value": '', "text": "{{ trans('english.PleaseSelect') }}"}],//当defaults为null时,填空使用这个
                optionData:option_marital,
                selected:'{{old('marital')}}'
            });
            //月薪
            var selectExpectedsalary = $("#expectedsalary").select({
                defaults:null,//默认按索引选中null为不选
                defaultFill:[{"value": '', "text": "{{ trans('english.PleaseSelect') }}"}],//当defaults为null时,填空使用这个
                optionData:option_expectedsalary,
                selected:'{{old('expectedsalary')}}'
            });
            //地区联动
            $("#homeaddress").selectArea({
                'province':$('#province'),
                'area':$('#area'),
                'city':$('#city'),
                'selected':"{{old('homeaddress')}}"
            });
            $("#census").selectArea({
                'province':$('#cprovince'),
                'area':$('#carea'),
                'city':$('#ccity'),
                'selected':"{{old('census')}}"
            });
            var resumeFrom = $('.rightMain').find("#resumeForm");
            resumeFrom.find("#workplaceInput").click(function(){
                workplaceInput('','type');
            });
            resumeFrom.find("#posCateInput").click(function(){
                posCateInput('');
            });
        });
    </script>
@endsection